<!DOCTYPE html>
<html>
	<head>
		<title>List: Validation</title>
		<link rel="stylesheet" href="../../codebase/webix.css" type="text/css" media="screen" charset="utf-8">
		<script src="../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>

		<link rel="stylesheet" type="text/css" href="../common/samples.css">		
		<script type="text/javascript" src="../common/testdata.js"></script>
		<style>
			.webix_list_item{
				text-overflow: ellipsis;
				white-space: nowrap;
			}

		</style>
	</head>
	<body>
		<div class='header_comment'>Validation in list</div>
		<div class='sample_comment'>Try to edit the list. If an item has an empty value it will fail the validation and be coloured in pink. </div>
		<div id="listA" style="margin:20px;"></div>

		<script type="text/javascript" charset="utf-8">
			webix.protoUI({
				name:"editlist"
			}, webix.EditAbility, webix.ui.list);

			webix.ui({
				container:"listA",
				view:"editlist", 
				width:320,
				height:600,

				template:"#rank#. #title#",

				editable:true,
				editor:"text",
				editValue:"title",

				rules:{
					title:webix.rules.isNotEmpty
				},

				ready:function(){
					//create invalid data
					this.getItem(2).title = "";
					this.updateItem(2);
				},

				data:big_film_set
			});


			
		</script>
	</body>
</html>